// @algorithm @lc id=100341 lang=cpp
// @title bu-ke-pai-zhong-de-shun-zi-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
    // @test([11,0,9,0,0])=true
public:
    bool isStraight(vector<int> &nums) {
        sort(nums.begin(), nums.end());
        int diff;
        int numOfKing = 0;
        for (int i = 0; nums[i] == 0; ++i) {
            ++numOfKing;
        }
        if (numOfKing <= 3) {
            for (int i = numOfKing + 1; i < 5; ++i) {
                diff = nums[i] - nums[i - 1];
                if (diff == 0) {
                    return false;
                }
            }
            diff = nums[4] - nums[numOfKing];
            return diff < 5;
        }
        return true;
    }
};